package cn.liufuwen.mapper;

import java.util.List;
import org.apache.ibatis.annotations.Select;
import cn.liufuwen.domain.OrdersDetail;

public interface OrdersDetailMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(OrdersDetail record);

    int insertSelective(OrdersDetail record);

    OrdersDetail selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(OrdersDetail record);

    int updateByPrimaryKey(OrdersDetail record);
    
    List<OrdersDetail> selectByUserID(Integer userId);
    
    List<OrdersDetail> selectByOrderID(Integer orderId);
    @Select("SELECT sum(price*number) from orders_detail where order_id=#{orderId}")
    String selectSumByOrderId(Integer orderId);
}